home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Run Magazine ReRun: Productivity Pak 1
/
rerun-productivity-pak-i.d64
/
disk master
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
11KB
|
319 lines
10 rem --------- disk master ---------
15 rem
20 rem single vic-1541 disk
25 rem on commodore-64 system
30 rem
35 rem robert w. baker
40 rem 15 windsor dr, atco, nj 08004
45 rem
50 rem
55 rem revised by:
60 rem
65 rem carl f. musolff
70 rem 4805 s 550 west
75 rem columbus, in 47201
80 rem
85 rem -------------------------------
90 :
100 poke56,127:poke55,255:clr:print"[147]please wait . . .[146]":gosub3050
110 c$="":s$=c$:x=.:y=.
120 cr$=chr$(13):hc$=chr$(147):rv$=chr$(18):rf$=chr$(146):cl$=chr$(157)
150 gosub2140:dimd$(230),x$(230)
160 print" reading directory cross reference"
170 open15,8,15,"i0":gosub2220
180 open5,8,5,"0:disk dir xref,s,r"
190 input#15,en,em$,et,es:ifen=62then290
200 input#5,x$(nx):ss=st:gosub2220:nx=nx+1:ifss=0then200
210 goto290
220 s$="":forx=1toy:gosub260:s$=s$+c$:nextx:return
230 forx=1toy:gosub260:nextx:return
240 v=.:gosub260:ifc$<>""thenv=asc(c$)
250 return
260 get#5,c$
270 ss=st:input#15,en,em$,et,es:ifen=0thenreturn
280 printhc$;rv$;"disk error!":print:goto2270
290 close4:close5:cx=.:gosub2140
300 printspc(5);"0 - done":print
310 printspc(5);"1 - update master directory":print
320 printspc(5);"2 - delete disk entry from master":print
330 printspc(5);"3 - display selected directory":print
340 printspc(5);"4 - find specified file":print
350 printspc(5);"5 - list disk id's and names"
360 gosub2150:print"enter desired function: ";
370 gosub2120:ifc$="0"thenprinthc$:goto2380
380 v=val(c$):ifv<1orv>5then370
390 onvgoto400,1180,980,1690,1250
400 close15:cx=0:printhc$;"insert disk to be cataloged"
410 print:print"depress any key to continue, ";rv$;"q";rf$;" to quit"
420 gosub2120:ifc$="q"thengosub2390:goto290
430 gosub2150:print"ok":open15,8,15,"io":gosub270
440 open5,8,5,"$0,s,r":gosub270
450 sysmk:vf=peek(679):nb=peek(680)+peek(681)*256
460 dn$="":fori=0to15:dn$=dn$+chr$(peek(682+i)):nexti
470 di$="":fori=0to1:di$=di$+chr$(peek(698+i)):nexti
500 gosub2160:ifc$="n"then970
510 ifnx=0then630
520 forx=0tonx-1:c$=left$(x$(x),2):ifdi$<c$then630
530 ifdi$<>c$thennextx:goto630
540 ifdn$=mid$(x$(x),3)then630
550 printhc$;rv$;"*** warning ***";rf$;" this disk id: ";rv$;di$;rf$
560 print:print"disk name: ";rv$;dn$
570 print:print"is already cataloged with a different"
580 print:print"disk name: ";rv$;mid$(x$(x),3):gosub2150
590 print"cataloging this disk will delete the"
600 print:print"previous data!":gosub2150
610 print"catalog this disk";:gosub2190:ifc$="n"then970
620 printhc$;"cataloging disk with new disk name"
630 gosub2150:print"reading directory entries ..."
635 fb=ws:w1=int(ws/256):poke254,w1:poke253,ws-w1*256
640 sysmj:df$=chr$(peek(702))+chr$(peek(703))
650 ifvf=1thendf$=" 1"
660 nf=.:ix=1:xf=peek(700):ifxf<1then850
670 f9=peek(fb):iff9<129then840
680 f$=chr$(f9):s$="":forj=1to18:s$=s$+chr$(peek(fb+j)):nextj
710 ifnf=.then740
720 forx=1tonf:ifleft$(s$,16)<mid$(d$(x),2,16)then750
730 next x
740 x=nf+1:goto760
750 fory=nftoxstep-1:d$(y+1)=d$(y):nexty
760 d$(x)=f$+s$:nf=nf+1
780 ifnf<155then840
790 printhc$;spc(6);rv$;"*** disk bam is invalid ***";rf$:gosub2150
800 print:print" current disk cannot be cataloged!":print:print:print
810 print" please verify or check disk contents":print
820 print"before attempting to catalog this disk.":print
830 gosub2150:gosub2110:goto970
840 fb=fb+19:ix=ix+1:ifix<xf+1then670
850 close5:gosub2390:gosub2150:print"updating master directory ..."
860 ifnx=.then910
870 forx=0tonx-1:c$=left$(x$(x),2):ifdi$<c$then900
880 ifdi$=c$then930
890 nextx:goto910
900 fory=nx-1toxstep-1:x$(y+1)=x$(y):nexty:goto920
910 x=nx
920 nx=nx+1
930 x$(x)=di$+dn$:cx=1
940 gosub2030:print#15,"s"+s$:open5,8,5,s$+",s,w":gosub270
950 print#5,df$;",";nb;cr$;:gosub270
960 ifnf>.thenforx=1tonf:print#5,d$(x);cr$;:gosub270:nextx
970 close5:gosub2290:goto400
980 printhc$;"to display disk directory":gosub1870:onvgoto290,980
990 open5,8,5,s$+",s,r":gosub270:gosub2070:input#5,df$,nb:gosub270
1000 print#4," ";rv$;"disk name:";rf$;" ";dn$:print#4
1010 print#4,""spc(4);rv$;"disk id:";rf$;" ";di$;spc(6)
1020 print#4,rv$;"disk format:"rf$;" "df$:print#4
1030 print#4,rv$;"blocks free:";rf$;" ";nb:print#4
1040 print#4,"---------------------------------------":print#4
1050 nf=.:ifss>.then1160
1055 w1=int(ws/256):poke254,w1:poke253,ws-w1*256
1060 sysmi:gosub260:ft=peek(ws):s$="":fori=1to16:s$=s$+chr$(peek(ws+i)):nexti
1065 z=peek(ws+17):v=peek(ws+18)
1070 print#4,right$(" "+str$(z+(256*v)),4);" ";s$;" ";
1080 ifft=129thenprint#4,"seq";
1090 ifft=130thenprint#4,"pgm";
1100 ifft=131thenprint#4,"usr";
1110 ifft=132thenprint#4,"rel";
1120 print#4:getc$:ifc$<>""thengosub2120
1130 ifc$="q"then1170
1140 nf=nf+1:ifss=.then1060
1150 print#4:print#4,rv$;"#files:";rf$;" ";nf
1160 ifpd=3thengosub2150:gosub2110
1170 close4:close5:goto980
1180 printhc$;"to delete disk from master directory"
1190 gosub1870:onvgoto1240,1180
1200 print#15,"s"+s$
1210 cx=.:forx=0tonx-1:ifleft$(x$(x),2)=di$thencx=1
1220 ifcxthenx$(x)=x$(x+1)
1230 next:nx=nx-1:goto1180
1240 gosub2290:goto290
1250 ifnx=.thengosub1880:goto290
1260 close4:gosub2140
1270 printspc(5);"0 - return to main function menu":print
1280 printspc(5);"1 - print full id usage chart":print
1290 printspc(5);"2 - quick list of id's in use":print
1300 printspc(5);"3 - list disk id's & names":print
1310 printspc(5);"4 - list ";rv$;"min";rf$;" free blocks per disk":print
1320 printspc(5);"5 - list ";rv$;"max";rf$;" free blocks per disk"
1330 gosub2150:print"enter desired function: ";
1340 gosub2120:ifc$="0"then290
1350 v=val(c$):ifv<1orv>5then1340
1360 printc$:onvgoto1370,1550,1620,2450,2490
1370 open4,4
1380 print#4,""spc(15);rv$;" d i s k i d u s a g e c h a r t "
1390 print#4:print#4," ";
1400 forx=48to90:ifx=58thenx=65
1410 print#4," ";chr$(x);:nextx:print#4
1420 z=.:forx=48to90:ifx=58thenx=65
1430 print#4," [219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219][192][219]";
1440 print#4,"[192][219][192][219][192][219][192][219][192][219][192][179]"
1450 print#4,chr$(x);
1460 fory=48to90:ify=58theny=65
1470 print#4,chr$(221);:ifz=nxthen1500
1480 c$=chr$(x)+chr$(y):s$=left$(x$(z),2)
1490 ifs$=c$thenprint#4,chr$(166);:z=z+1:goto1510
1500 print#4," ";
1510 next y:print#4,chr$(221):getc$:ifc$<>""thengosub2120
1520 ifc$<>"q"thennextx
1530 print#4," [177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177][192][177]";
1540 print#4,"[192][177][192][177][192][177][192][177][192][177][192][189]":goto1260
1550 gosub2070:print#4,""spc(7);"disk id's currently in use"
1560 print#4:print#4
1570 v=12:ifpd=4thenv=25
1580 z=.:forx=0tonx-1:print#4,left$(x$(x),2);" ";
1590 z=z+1:ifz=int(z/v)*vthenprint#4
1600 nextx:print#4:print#4:ifz<>int(z/v)*vthenprint#4
1610 print#4,z;rv$;"disks in master directory":goto1670
1620 gosub2070:print#4,rv$;"id ...disk name....":print#4
1630 forx=0tonx-1:print#4,left$(x$(x),2);" ";mid$(x$(x),3)
1640 getc$:ifc$<>""thengosub2120
1650 ifc$="q"then1260
1660 nextx
1670 ifpd=4then1260
1680 gosub2150:gosub2110:goto1260
1690 ifnx=.thengosub1880:goto290
1700 close4:printhc$;"to find what disk(s) a file is on":print
1710 print"enter file name .";cl$;cl$;cl$;:inputf$:iff$="."then290
1720 iff$="*"thenprint:print"re-";:goto1710
1725 w1=int(ws/256):poke254,w1:poke253,ws-256*w1
1730 s$=f$:gosub2040:v=y:gosub2070:pokemp,v+1
1735 f1$="0"+f$+"0":forf1=2tov+1:pokewf+f1-1,asc(mid$(f1$,f1,1)):nextf1
1740 print#4,rv$;"...file name.... id ...disk name....":print#4
1750 print#4,s$:print#4
1760 forz=0tonx-1:di$=left$(x$(z),2):dn$=mid$(x$(z),3)
1770 gosub2030:open5,8,5,s$+",s,r":ef=15:gosub270:input#5,df$,nb:gosub270
1780 sysml:p2=peek(2)+1:onp2goto1810,1790,1810,1790
1790 s$="":fori=1to16:s$=s$+chr$(peek(ws+i)):nexti
1800 print#4,s$;" ";di$;" ";dn$:rem <- 2 spaces ea
1810 getc$:ifc$<>""thengosub2120
1820 ifc$="q"thenclose5:goto1700
1830 onp2goto1840,1780,1840,1840
1840 clo